I want to get a Javascript alert when a user in photoshop apply a action by click. check this Screenshot .Here, When user click on gray color action will be applied after that it should give a alert that completed.
i tried below this code, but its not working. Looking forward your help.
app.actions["actionName"].onComplete(function(){ alert('action name - completed') })
You'll want a function that will call the action. In my example, I've got an action that flattens all the layers. Just replace the name of the action and it's action set with the one you want ("Check new with trim").
// Play action
// replace these parameters with your own
play_action("Flatten layers", "My Favourite Actions");
function play_action(actName, actSet)
{
// =======================================================
var idPly = charIDToTypeID( "Ply " );
var desc1784 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref572 = new ActionReference();
var idActn = charIDToTypeID( "Actn" );
ref572.putName( idActn, actName ); // Action name
var idASet = charIDToTypeID( "ASet" );
ref572.putName( idASet, actSet ); // Action set name
desc1784.putReference( idnull, ref572 );
executeAction( idPly, desc1784, DialogModes.NO );
alert("action " + actName + " complete.")
}